<template>
  <div>
    <el-dialog title="汇报检验单详情"  width="1100px" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>
      <el-form ref="form" :model=" prdreportinspectform " size="small" label-width="80px" :inline="true" class="header">
        <el-row>
          <el-col :span="8">
            <el-form-item label="汇报检验单据编号:" class="no-wrap-label" label-width="130px">{{ prdreportinspectform.fbillNo }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="金蝶单据编号:" class="no-wrap-label" label-width="130px" >{{ prdreportinspectform.fkdbillno }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="生产订单编号:" class="no-wrap-label" label-width="130px">{{ prdreportinspectform.fbillnomo }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单据日期:" class="no-wrap-label">{{ prdreportinspectform.fdate }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="质检员:" class="no-wrap-label">{{ prdreportinspectform.inspectUser }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="质检时间:" class="no-wrap-label">{{ prdreportinspectform.inspectDate }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="创建人:" class="no-wrap-label">{{ prdreportinspectform.fcreateuser }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="创建日期:" class="no-wrap-label">{{ prdreportinspectform.createTime }}</el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="单据状态:" class="no-wrap-label">
              {{ prdreportinspectform.fstate === 1 ? '作废' : '审核' }}
            </el-form-item>
          </el-col>


        </el-row>

        <br />
      </el-form>

      <el-table :data="prdreportinspectdetailList" height="calc(100vh - 300px)">
        <el-table-column label="汇报检验单据编号" width="130" prop="fbillNo"></el-table-column>
        <el-table-column label="物料编码" width="120" prop="materialName"></el-table-column>
        <el-table-column label="物料名称" width="120" prop="materialNo"></el-table-column>
        <el-table-column label="规格型号" width="120" prop="specification"></el-table-column>
        <el-table-column label="单位名称" width="120" prop="unitName"></el-table-column>
        <el-table-column label="单位编码" width="120" prop="unitNo"></el-table-column>
        <el-table-column label="辅助单位编码" width="120" prop="fauxUnitNo"></el-table-column>
        <el-table-column label="辅助单位名称" width="120" prop="fauxUnitName"></el-table-column>
        <el-table-column label="检验数量" width="120" prop="inspectQty"></el-table-column>
        <el-table-column label="不合格数量" width="120" prop="unqualifiedQty"></el-table-column>
        <el-table-column label="合格数量" width="120" prop="qualifiedQty"></el-table-column>
        <el-table-column label="仓库名称" width="120" prop="stockName"></el-table-column>
        <el-table-column label="仓位名称" width="120" prop="locationName"></el-table-column>
        <el-table-column label="批号" width="120" prop="flot"></el-table-column>
      </el-table>
    </el-dialog>

  </div>
</template>
<script>
import { detail  } from '@/api/app/prdreportinspect'
export default {
	name:'prdreportinspectdetail',
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
      prdreportinspectform:{},
      prdreportinspectdetailList:[]
		}
	},
	watch:{
		show(val){
			if(val){
			}
		}
	},
	methods: {
    open(){

      detail(this.info).then(res => {

        if (res.status == 200) {
          this.prdreportinspectform = res.data.data;
          this.prdreportinspectdetailList = res.data.dataList;
          console.log('receList',this.receList)

        } else {
          this.$message.error('获取详情失败2，请稍后再试');
        }
      }).catch(error => {

        this.$message.error('获取详情失败，请稍后再试');
      });
		},
		closeForm(){
			this.$emit('update:show', false)
		}
	}
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss';
</style>
